import { IconHeight, IconWidth } from './Config';
import { IconData } from './IconData';

export function IntersectsBox(left: number, top: number, width: number, height: number, i: IconData): boolean
{
    let maxx = left + width;
    let maxy = top + height;

    let minx2 = i.x;
    let miny2 = i.y;

    let maxx2 = minx2 + IconWidth;
    let maxy2 = miny2 + IconHeight;

    return maxx < minx2 || left > maxx2 ||
        maxy < miny2 || top > maxy2 ? false : true;
}
